#include <iostream>
#define N 100

using namespace std;


void read_matrix(char matrix[N][N], int row, int column){
int i, j;
for (i=0;i<row;i++)
    for(j=0;j<column;j++){
        cout<<"m["<<i<<"]["<<j<<"]= ";
        cin>>matrix[i][j];}
}

void printVector(char array[], int elements){
for(int i=0; i<elements; i++){
	cout<<array[i]<<" ";}
	cout<<"\n";
}

int main(){
int row;
int column;
char matrix[N][N];
char array[N];
int elements=0;
int i,j;


cout<<"Type the number of rows: " ;
cin>>row;

cout<<"Type the number of columns: " ;
cin>>column;

read_matrix(matrix, row, column);

i=0;
for(j=column-1;j>=0;--j){
    array[elements]=matrix[i][j];
    ++i;
    ++elements;}

cout<<"The characters on the diagonal are: "<<endl;

printVector(array, elements);

return 0;
}
